home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_oth / tm480 / tmexam.exe / HVMENU.TSK < prev    next >
Text File  |  1991-09-10  |  8KB  |  334 lines

  1. ; Title   : HVMENU.TSK                  Last Updated : June 12, 1991
  2. ; Author  : Steve Johnson - FmP.        Version      : 1.10
  3. ; Purpose : Example of horizontal and vertical bounce-bar menus
  4. ; Notes   : Whilst on a sub menu you may press left and right arrow
  5. ;           keys which are programmed to drop down adjacent vertical menu.
  6. ;           Note that each menu highlight is remembered for next time menu
  7. ;           displayed.
  8. ; Latest  : Main menu help only displayed on 2 second timeout
  9.  
  10. var formlist,1,occurs 6,' 12345'
  11. var hilite_list,1,occurs 6      ;remembers sub menu options selected
  12. var tname,8,"  HVMENU"          ;For insertion into NO_FORMS only
  13. int count            ;decides colour of main menu help 
  14. int main_choice                 ;remembers main menu option selected
  15. logical exit
  16. hexvar safeopen,2cfaf4f3f5f0
  17. var compare,6
  18. var skey,10,'Secret'
  19. int i
  20. int pid1,pid2,pid3,pid4
  21. vconst cls,11
  22. vconst cel,55
  23. vconst nor,5
  24. vconst attn,79
  25. END
  26. lookfor "hvmenu.ovr"
  27. if not found
  28.   insert tname tname
  29.   put "NO_FORMS"
  30.   stop
  31. fi
  32. forms hvmenu.ovr
  33. display cls
  34. put closed_safe wait 1 noclear
  35. popget pid4
  36. put part_closed_safe wait 1 noclear
  37. popget pid1
  38. put open_safe wait 1 noclear
  39. popget pid2
  40. put part_closed_safe wait 1 noclear
  41. popget pid3
  42. put closed_safe nowait 
  43. move 8000h to bbmask
  44. move 2 to timer
  45. MENU 1,"HORIZONTAL"
  46. option 1,6
  47. option 1,30
  48.   cursor 5 50 nor cel
  49.   ask exit attn 'Exit this task?'
  50.   cursor 5 50 nor cel
  51.   if not exit
  52.     return
  53.   fi 
  54.   stop
  55. option 1,1,5
  56.   move choice to main_choice
  57.   move 18H to bbmask              ;activate left and right arrow keys
  58.   move entry main_choice of hilite_list to choice
  59.   PUT entry main_choice of formlist
  60.   move hilite to entry main_choice of hilite_list
  61.   move hilite_list to compare
  62.   encode compare using skey
  63.   cursor 5 50 nor 'Checking...'
  64.   if safeopen = compare
  65.     cursor 5 50 cel attn 'Well done...' 
  66.     clear count
  67.     until count = 10
  68.       move count to delay
  69.       popdown pid1
  70.       wait 1
  71.       popdown pid2
  72.       wait 1
  73.       popdown pid3
  74.       wait 1
  75.       popdown pid4
  76.       wait 1
  77.     fi count
  78.     put fully_open_safe nowait 
  79.     stop
  80.   else
  81.     cursor 5 50 cel 'Wrong combination'
  82.   fi
  83.   if choice = 42
  84.     userline nor "Right arrow"
  85.     increment main_choice
  86.     move main_choice to choice
  87.     RETURN 100
  88.   fi
  89.   if choice = 41
  90.     userline nor "Left arrow"
  91.     decrement main_choice
  92.     move main_choice to choice
  93.     RETURN 100
  94.   fi
  95.   move main_choice to choice
  96.   return
  97. option 1,99
  98.   if count < 1
  99.     increment count
  100.   else
  101.     clear count
  102.   fi
  103.   if count = 0
  104.     put 'MMHELP1' nowait
  105.   else 
  106.     put 'MMHELP2' nowait
  107.   fi
  108.   move hilite to choice
  109.   return
  110. endm 1
  111. stop
  112. @video
  113. @nf horizontal
  114. @overlay
  115.  
  116.  
  117. @bbmenu white,blue
  118.     {one   } {two   } {three } {four  } {five  } {EXIT }
  119. @end
  120. @nf mmhelp1
  121. @colour char,white,blue
  122. @window line 12,column 10,depth 4,width 30
  123.  This is the main menu. Press
  124.  <return> to drop down a sub-
  125.  menu.  Select using <space>,
  126.  Arrow keys or 1st chars.
  127. @end
  128. @nf mmhelp2
  129. @colour char,white,red
  130. @window line 12,column 10,depth 4,width 30
  131.  This is the main menu. Press
  132.  <return> to drop down a sub-
  133.  menu.  Select using <space>,
  134.  Arrow keys or 1st chars.
  135. @end
  136. @nf 1
  137. @overlay
  138. @colour char,blue,green
  139. @dim
  140.  
  141.  
  142.     *one***
  143. @bbmenu white,blue
  144.     {one   }
  145.     {two   }
  146.     {three }
  147.     {four  }
  148.     {five  }
  149. @colour char,white,red
  150. @bright
  151. @window line 12,column 10,depth 4,width 30
  152.  This is sub menu one. Please 
  153.  highlight a topic and  press 
  154.  <return> or press <left>  or 
  155.  <right> arrow key.
  156. @END
  157. @nf 2
  158. @overlay
  159.  
  160.  
  161. @colour char,blue,green
  162. @dim
  163.             *two***
  164. @bbmenu white,blue
  165.             {one   }
  166.             {two   }
  167.             {three }
  168.             {four  }
  169.             {five  }
  170. @colour char,black,yellow
  171. @window line 12,column 10,depth 4,width 30
  172.  This is sub menu two. Please 
  173.  Highlight a topic and  press 
  174.  <return> or press <left>  or 
  175.  <right> arrow key.
  176. @END
  177. @nf 3
  178. @overlay
  179.  
  180.  
  181. @colour char,blue,green
  182. @dim
  183.                     *three*
  184. @bbmenu white,blue
  185.                     {one   }
  186.                     {two   }
  187.                     {three }
  188.                     {four  }
  189.                     {five  }
  190.                     {six   }
  191. @colour char,black,red
  192. @window line 12,column 10,depth 4,width 30
  193.  This  is sub menu  three.  I 
  194.  hope  you realise  that  you 
  195.  can press 1st character of a 
  196.  topic to highlight it.
  197. @END
  198. @nf 4
  199. @overlay
  200.  
  201.  
  202. @colour char,blue,green
  203. @dim
  204.                             *four**
  205. @bbmenu white,blue
  206.                             {one   }
  207.                             {two   }
  208.                             {three }
  209.                             {four  }
  210. @colour char,magenta,cyan
  211. @bright
  212. @window line 12,column 10,depth 4,width 30
  213.  This is sub-menu four.   The 
  214.  combination  is   encrypted.  
  215.  The security would be higher 
  216.  if the key was also... 
  217. @END
  218. @nf 5
  219. @overlay
  220.  
  221.  
  222. @colour char,blue,green
  223. @dim
  224.                                     *five**
  225. @bbmenu white,blue
  226.                                     {one   }
  227.                                     {two   }
  228.                                     {three }
  229.                                     {four  }
  230.                                     {five  }
  231.                                     {six   }
  232.                                     {seven }
  233. @colour char,cyan,blue
  234. @window line 12,column 10,depth 4,width 30
  235.  You  can see the  encryption 
  236.  key  by looking at the  task 
  237.  source.   Perhaps  you   can 
  238.  find a way to cheat?
  239. @END
  240. @nf closed_safe
  241. @head left,HVMENU.TSK
  242. @head right,'Taskmaster (c) FmP 1991'
  243. @head centre,'A combination SAFE'
  244. @banner
  245. @win line20,column5,depth4,width40
  246. The safe can be opened using
  247. the correct combination of
  248. selections from the secondary
  249. menus...
  250. @window line6,column47,depth14,width27
  251. @gon
  252. @colour char,white,black
  253. @bright
  254. 7-------------------------9
  255. 0  7-------------------9  0
  256. 0 729                  0  0
  257. 0 0 0                  0  0
  258. 0 0 0                  0  0
  259. 0 183                  0  0
  260. 0  0                   0  0
  261. 0  0                   0  0
  262. 0  0                   0  0
  263. 0 729                  0  0
  264. 0 0 0                  0  0
  265. 0 0 0                  0  0
  266. 0 183                  0  0
  267. 0  1-------------------3  0
  268. 1-------------------------3
  269. @end
  270. @nf fully_open_safe
  271. @colour char,white,black
  272. @window line6,column33,depth14,width41
  273. @gon
  274. @bright
  275.               7-------------------------9
  276. 7----------------9                      0
  277. 0 7-----------9 729 7---------------9   0
  278. 0 0           0 0 0 07-------------90   0
  279. 0 0    Acme   0 0 0 00  Taskmaster 00   0
  280. 0 0    Safe   0 183 00  Source code00   0
  281. 0 0    Co.    0  0  00   7-------9 00   0
  282. 0 0           0  0  00   0       6 00   0
  283. 0 0           0  0  00   0   O   0 00   0
  284. 0 0           0 729 00   0   0   0 00   0
  285. 0 0           0 0 0 00   1-------3 00   0
  286. 0 0           0 0 0 01-------------30   0
  287. 0 1-----------3 183 1---------------3   0
  288. 1----------------3                      0 
  289.               1-------------------------3
  290. @end
  291. @nf part_closed_safe
  292. @colour char,white,black
  293. @window line6,column47,depth14,width27
  294. @gon
  295. @bright
  296. 7-------------------------9
  297. 0  7---------9            0
  298. 0 76         49-------9   0
  299. 0 00         00------90   0
  300. 0 00         00aster 00   0
  301. 0 16         00e code00   0
  302. 0  0         00----9 00   0
  303. 0  0         00    6 00   0
  304. 0  0         00O   0 00   0
  305. 0 76         000   0 00   0
  306. 0 00         00----3 00   0
  307. 0 00         00------30   0
  308. 0 16         43-------3   0
  309. 0  1---------3            0
  310. 1-------------------------3
  311. @end                   
  312. @nf open_safe          
  313. @colour char,white,black
  314. @window line6,column47,depth14,width27
  315. @gon
  316. @bright
  317. 7-------------------------9
  318. 0  7----9                 0
  319. 0 76    49------------9   0
  320. 0 00    00-----------90   0
  321. 0 00    00Taskmaster 00   0
  322. 0 16    00Source code00   0
  323. 0  0    00 7-------9 00   0
  324. 0  0    00 0       6 00   0
  325. 0  0    00 0   O   0 00   0
  326. 0 76    00 0   0   0 00   0
  327. 0 00    00 1-------3 00   0
  328. 0 00    00-----------30   0
  329. 0 16    43------------3   0
  330. 0  1----3                 0
  331. 1-------------------------3
  332. @end
  333. @eof
  334.